package JAVA300.第十一章多线程;

/**
 * 测试yield
 */

public class thread_11_threadState_yield0 {
    public static void main(String[] args) {
        myYield yield = new myYield();

        new Thread(yield,"a").start();
        new Thread(yield,"b").start();

    }
}

class myYield implements Runnable{

    @Override
    public void run() {
        System.out.println(Thread.currentThread().getName()+"-->"+"start");
        Thread.yield();

        System.out.println(Thread.currentThread().getName()+"-->"+"end");

    }
}
